#if defined(_MSC_VER)
#pragma once
#endif

#ifndef LM_TEXTURE_SCALE_H
#define LM_TEXTURE_SCALE_H

#include "../core/lm.h"
#include "../core/texture.h"

template<typename T1, typename T2>
class ScaleTexture : public Texture<T2> {
public:
	ScaleTexture(Reference<Texture<T1>> t1, Reference<Texture<T2>> t2) {
		tex1 = t1;
		tex2 = t2;
	}
	T2 Evaluate(const Intersection &isect) const {
		return rex1->Evaluate(isect) * tex2->Evaluate(isect);
	}
	~ScaleTexture() {
		tex1 = NULL;
		tex2 = NULL;
	}
private:
	Reference<Texture<T1>> tex1;
	Reference<Texture<T2>> tex2;
};

#endif	// LM_TEXTURE_SCALE_H